package com.sh4.entity;


import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.hibernate.annotations.GenericGenerator;

/**
 * Menu entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "menu")
@JsonIgnoreProperties(value = { "parentMenu" })
public class Menu implements java.io.Serializable {

	// Fields

	private String id;
	private String url;
	private String label;
	private String icon;
	private String parentId;
	private Date creatTime;
	private String creatPerson;
	private Date updateTime;
	private String updatePerson;
	private Boolean status;
	private String remark;
	private List<Menu> childrenMenu = new ArrayList<Menu>(0);

	// Constructors

	/** default constructor */
	public Menu() {
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "ID_", unique = true, nullable = false, length = 50)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "URL_", length = 100)
	public String getUrl() {
		return this.url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	@Column(name = "LABEL_", length = 100)
	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}
	

	public String getIcon() {
		return icon;
	}
	
	@Column(name = "ICON_", length = 50)
	public void setIcon(String icon) {
		this.icon = icon;
	}

	@Column(name = "PARENT_ID_", length = 50)
	public String getParentId() {
		return this.parentId;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

	@Column(name = "CREAT_TIME_")
	public Date getCreatTime() {
		return this.creatTime;
	}

	public void setCreatTime(Date creatTime) {
		this.creatTime = creatTime;
	}

	@Column(name = "CREAT_PERSON", length = 100)
	public String getCreatPerson() {
		return this.creatPerson;
	}

	public void setCreatPerson(String creatPerson) {
		this.creatPerson = creatPerson;
	}
	
	@Column(name = "UPDATE_TIME_")
	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public String getUpdatePerson() {
		return updatePerson;
	}

	@Column(name = "UPDATE_PERSON", length = 100)
	public void setUpdatePerson(String updatePerson) {
		this.updatePerson = updatePerson;
	}

	@Column(name = "STATUS_", length = 50)
	public Boolean getStatus() {
		return this.status;
	}

	public void setStatus(Boolean status) {
		this.status = status;
	}

	@Column(name = "REMARK_")
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

//	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "parentId")
//	@OrderBy("id")
	@Transient
	public List<Menu> getChildrenMenu() {
		return childrenMenu;
	}

	public void setChildrenMenu(List<Menu> childrenMenu) {
		this.childrenMenu = childrenMenu;
	}

}